#ifndef _CAR_H_
#define _CAR_H_

#include "Box2D\Box2D.h"

class Car    // TO DO : class with pointers, but no operator= or copy constructor!
{
private:
	b2Body*           ap_chassis;
	b2Body*           ap_frontWheel;
	b2Body*           ap_backWheel;
	b2RevoluteJoint*  ap_frontWheelJoint;
	b2RevoluteJoint*  ap_backWheelJoint;
	b2World*          ap_gameWorld;
protected:
	void createChassis(b2Vec2 position);
	void createWheels();
	void createJoints();
	void prepareMotors();
	void connectToGameWorld(b2World* p_gameWorld);
	void buildCar(b2Vec2 position);
	void disconnectFromGameWorld();
	Car();
public:
	Car(b2World* p_gameWorld, b2Vec2 position);
	~Car();
	b2Vec2 getCarPosition();
	void turnMotorsOnWith(float32 speed);
	void turnMotorsOff();
	void brake();
};

#endif